package per.hx.bs.sys.serviceimpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import per.hx.bs.entity.sys.SysEmailDO;
import per.hx.bs.sys.dao.SysEmailDao;

/**
 * @author HuXing
 * @date 2018/4/26  11:20
 */

@Transactional(rollbackFor = Exception.class)
@RestController
@RequestMapping(value = "sys-service/email")
public class SysEmailApiServiceImpl {

    private final
    SysEmailDao emailDao;

    @Autowired
    public SysEmailApiServiceImpl(SysEmailDao emailDao) {
        this.emailDao = emailDao;
    }


    /**
     * 插入邮件发送信息
     *
     * @param emailDO 邮件信息
     */
    @PostMapping(value = "/insert")
    public int insertEmail(@RequestBody SysEmailDO emailDO) {
        return emailDao.insert(emailDO);
    }
}
